<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<META NAME="AUTHOR" CONTENT="Jeremiah Lewis with code form Shawn Rivera & Matt Rykaczewski">
	<META NAME="REVISED" CONTENT="08/06/09">
	<META NAME="PUBLISHER" CONTENT="State of Alaska, Department of Natural Resources">
	<META NAME="KEYWORDS" CONTENT="report builder">
	<META NAME="DESCRIPTION" CONTENT="Report Builder allows users to generate reports for the DNR Bussiness Reporting System from the Land Administration System (LAS) databases.">
	<title>DBRS Report Builder 1.0</title>
	<style type="text/css" media="all">
	@import url("http://int.dnr.alaska.gov/shared/css/dnr2008.css");
	@import url("ReportBuilder.css");
	</style>
	<script src="js/jquery.min.js" type="text/javascript"></script>
	<script src="js/json2.js" type="text/javascript"></script>
	<script language="javascript">
		var has_numbers=new RegExp("[0-9]+"),
			not_valid=new RegExp("[^0-9|\s]+");

		function error(message,span,status)
		{
			if(status == 1)
			{
				span.html('<b style="color:rgb(255,17,17)">'+message+'</b>');
			}
			else
			{
				span.html('<b style="color:rgb(0,0,255)">'+message+'</b>');
			}
		}
				
		function doFormSubmit(newID,editID,message) 
		{
			error('OK',message,0);
			if(editID != 'null')
			{
				window.document.ReportID.SUBMIT.value = editID;
				window.document.ReportID.PURPOSE.value = 'edit';
				window.document.ReportID.url.value = "ChooseReport.jsp";
				window.document.ReportID.reqtype.value = 'FORM';
				window.document.ReportID.submit();
				return false;
			}

			// formatting the string
			newID=newID.replace(/\s/g,"");
			if(newID.length < 2)
				newID = '0'+newID;
			if(newID.length < 3)
				newID = '0'+newID;
			if(newID.length < 4)
				newID = '0'+newID;
			if(newID.length < 5)
				newID = '0'+newID;
			if(has_numbers.test(newID) && newID != '0000')
			{
				if(not_valid.test(newID))
				{
					error('The report number entered for the new report is not a valid number.',message,1);
					return false;
				}
				else
				{
					// test to see if the new ID is already on the list of IDs to be edited
					$("select").val(newID);
					if($("select").val() == 'null')
					{
						// The new ID is not already taken
						window.document.ReportID.SUBMIT.value = newID;
						window.document.ReportID.PURPOSE.value = 'create';
						window.document.ReportID.url.value = 'ChooseReport.jsp';
						window.document.ReportID.reqtype.value = 'FORM';
						window.document.ReportID.submit();
						return false;
					}
					else
					{
						$('#new_report_id').val(null);
						$("select").val('null');
						error('There is already a report with ID number '+newID+'.',message,1);
						return false;
					}
				}
			}
			else
			{
				error('Invalid Input',message,1);
			}
  		} // end function doFormSubmit
		
		function checkCR(evt) 
		{
			var evt  = (evt) ? evt : ((event) ? event : null);
				
			if (evt.keyCode == 13) 
			{
				doFormSubmit($('#new_report_id').val(),$('#report_list').val(),$('#errorMessage'));
				return false;
			}
		} // end function checkCR

		function getList()
		{
			$("#report_list").load("List", {"PURPOSE":"ID list","reqtype":"FORM","url":"ChooseReport.jsp"}, function(data)
			{
				if(data.indexOf('option') == 1)
				{
					$("#report_list").html(data);
				}
				else
				{
					$("#report_list").html("<option value='null' selected='selected'>None</option>");
					error("An error occured when connecting to the server.",$('#errorMessage'),1);
				}
			});
		}

  		document.onkeypress = checkCR; 
	</script>
</head>
<%@ page import="reportBuilder.Gofor" %>
<body background="http://int.dnr.alaska.gov/shared/images/dnrbackground48x48.gif" bgcolor="#ffffff" leftmargin="0" marginheight="0" marginwidth="0" topmargin="0" class="bodytext" onload='getList();'>
<!--- Start of header --->
<div id="container"><!--begin container -->

<div id="header_links"><!--begin header links -->
<a href="http://www.alaska.gov/" title="The State of Alaska"><img id="state_icon" src="http://int.dnr.alaska.gov/shared/images/state_home_icon_transparent.gif" alt="The State of Alaska"/></a>
<a href="#skip_nav"></a><a href="http://www.alaska.gov/" title="The State of Alaska" id="top_header">State of Alaska</a> 
<a href="http://www.dnr.alaska.gov/ssd/lris/gis/" id="top_header">External GIS Page</a> 
<a href="http://int.dnr.alaska.gov/ssd/lris/gis/" id="top_header">Internal GIS Page</a> 
<a href="http://int.dnr.alaska.gov/" id="top_header">DNR Internal Page</a> 
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
	<input type="hidden" name="department2" value="GPU" />
	<label for="search for2"  class="searchform">
	<input type="text" name="q" size="11" id="searchfor2" maxlength="255" />
	</label>
	<input  type="submit" name="submit" class="searchform" value="Search" alt="Search"/>
	<form id="google_form1" action="http://int.dnr.alaska.gov/shared/templates/veritysearchresults.cfm" method="post">
	<input type="hidden" name="department" value="GPU" />
</form>
</div>
<!--end header links -->
	
<!--- End header bar links --->

	<!--- End header bar links --->
	<img alt="Alaska Department of Natural Resources, Geographic Information Services, Programming Unit" src="http://int.dnr.alaska.gov/shared/images/banners/gis75.jpg" border="0"></img>
		  <!-- About DNR -->
		<!--- End page banner graphic --->
	<!--- End Header --->

<br/>&nbsp;&nbsp;&nbsp; <a href="http://www.alaska.gov/" class="context">State of Alaska</a> <span style="font-size: 9.5pt">&gt;</span> <a href="/" class="context">Natural Resources</a> <span style="font-size: 9.5pt">&gt;</span> <a href="http://int.dnr.alaska.gov/ssd/lris/gis/" class="context">GPU</a> <span style="font-size: 9.5pt">&gt;</span>&nbsp;<a href="./">User Log In</a>
<div id="mainBody">

<table width="517" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
	<tr>
		<!--- Left spacer --->
	  	<td align="left" valign="top" bgcolor="white" width="64"></td>
	  	<!--- Start page body --->
  	  	<td width="477" class="bodytext"> 
			<a name="skip_nav"></a>
			<p align="center"><span class="head3">Choose Report ID</span></p>
			<form name="ReportID" action="List" method="post">
			<input type="hidden" name="reqtype" value="FORM"/>
            <input type="hidden" name="SUBMIT"/>
            <input type="hidden" name="PURPOSE"/>
            <input type="hidden" name="url"/>
          	<table width="273" border="1" bgcolor="#FFFFFF" align="center">
             <tr>
                    <td width="150"><div class="bodytextboldblue" align="right">Create New Report:</div></td>
                    <td><input id="new_report_id" type="text" size="15" maxlength="5" /></td>
                </tr>
                <tr>
                    <td width="150"><div align="right" class="bodytextboldblue" align="right">Edit Report:</div></td>
                    <td>
						<select name="report_list" id="report_list" >
							<option value="null" selected="selected">None</option>
                    	</select>
                    </td>
                </tr>
                <tr>
                    <td colspan="2">
                    	<div align="center">
                    		<input type="button" name="FB_AUTHENTICATE" value="Get/Create Report" onclick="doFormSubmit($('#new_report_id').val(),$('#report_list').val(),$('#errorMessage'));" />
                    		&nbsp;&nbsp;
                    		<input type="reset"/>
                    	</div>
                    </td>
                </tr>
                <tr>
                    <td colspan="2" height="50" valign="top">
                    	Messages: 
                    	<span id="errorMessage" class="context"><b style="color:rgb(0,0,255)">OK</b></span>
                    </td>
              </tr>
            </table>
            </form>
	        <p/>
			<p/>
			<p/>
	  	</td>
		<!--- End page body --->
		<!--- Right spacer --->
      	<td width="64">&nbsp;</td>
	</tr>
</table>
<div id="footer" class="small"><!--- Edit footer lines below --->
	<div class="small">
		<p>
      	<%String ver = " v" + Gofor.VERSION; %>
		DNR Report Building System<%= ver %>. Site optimized for Netscape 7, IE 6 or above.<br/>
       	Not sure who to contact? Have a question about DNR? 
		Visit the <a href="http://www.dnr.state.ak.us/pic/" class="note">Public Information Center</a>.<br/>
		For help using the DNR Business Reporting System, please view the <a href="/docs/DBRS_User_Help_Guide.pdf" target="_blank" class="note">User Help Guide</a>.<br/>
       	For additional help or support, please view the <a href="http://dnr.alaska.gov/CustomerFeedback/FAQPage?pid=6&ref=http://reports.dnr.alaska.gov" target="_blank" class="note">DBRS Support/FAQ</a>.<br/>
       	Report technical problems with this page to the <a href="http://www.dnr.state.ak.us/standard/emailcontact.cfm?send=valerie.johnston">Webmaster</a>
       	</p>
  	</div>
</div>	 
         <center><a href="http://www.state.ak.us" class="footer">State of Alaska</a>&nbsp; 
          <a href="http://www.dnr.state.ak.us" class="footer">Natural Resources</a> &nbsp; 
	<!-- Edit Links to your division/offices home page -->
		  <a href="http://int.dnr.alaska.gov/int/webmasters" class="footer">Webmaster's Center</a>&nbsp;&nbsp;
	<!-- End Edit Links -->
		  <a href="http://int.dnr.alaska.gov/shared/notices/copyright.htm" class="footer">Copyright</a>&nbsp;&nbsp; 
          <a href="http://int.dnr.alaska.gov/shared/notices/privacy.htm"  class="footer"> Privacy</a> &nbsp; 
          <a href="http://int.dnr.alaska.gov/shared/status/systemstatus.cfm" class="footer">System Status</a> 
		</center> <!--end container -->
</div>
</div>
</body>
</html>
